﻿// copyright (c) 2025 author:fio66<fio66@foxmail.com>. All rights reserved.
// date: 2025-08-22 10:59:25

#include "src/player/audio_player.h"

namespace fio66 {

bool AudioPlayer::Play(std::string_view url) {
  return demuxer_->Demuxing(url, this);
}
void AudioPlayer::Pause() { demuxer_->PauseDemuxing(); }

void AudioPlayer::Stop() { demuxer_->QuitDemuxing(); }

void AudioPlayer::SetVolume(int volume) {}

int AudioPlayer::GetVolume() { return 0; }

void AudioPlayer::Seek(double time_s) {
  demuxer_->SeekTo(time_s);
}

double AudioPlayer::GetCurrentTime() {
  return demuxer_->GetCurrentPosition();
}

double AudioPlayer::GetDuration() { return demuxer_->GetDuration(); } 

void AudioPlayer::OnRecieveMediaData(MediaDataType type, uint8_t* data,
                                     size_t size) {}

void AudioPlayer::OnEvent(EventType event_type, const std::any& data) {
  // TODO
}


}  // namespace fio66